(function($, gmwk) {
  
    // Configure and bootstrap when the document is ready
    $(
        function () {
              
            gmwk.setLibPath("js/lib/");
            gmwk.setLocalPath("js/classes/");
            gmwk.setTemplatePath("templates/");
            //gmwk.setTemplatePath("file:///Volumes/Data/Web/gmwebkit/templates/");
            gmwk.setVersion(0.1);
            gmwk.setLiveEnvironment(false);
            gmwk.setDebugStatus(true);
            gmwk.setTemplateContainer($("#gmwk_templates"));
            gmwk.setStageContainer($("#gmwk_stage"));
            
            gmwk.create("API", {bSingleton: true});
            gmwk.create("Router", {bSingleton: true});
      
            gmwk.create(
                "QOTD",
                {
                    bSingleton: true,
                    sTemplate: "QOTD",
                    jqParentContainer: $(".QOTD_container")
                }
            );
            
            gmwk.bAuthorized = true;  // Not secure at all, done for simplicity!
      
            // Check URL for state
            if (!gmwk.Router.route()) {
                // If no known state specified load landing page.
                //gmwk.Router.load({stage: "Blog"}, gmwk.Router.PARAMS_REPLACE_STATE());
                gmwk.Router.load({stage: "Dashboard"}, gmwk.Router.PARAMS_REPLACE_STATE());
                //gmwk.Router.notFound();
            }
    
        }
    );
    
})(jQuery, window.gmwk);

